package com.minivision.sdktestdemo.theme.ui;

import android.content.Context;
import android.content.res.Resources;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;

import com.minivision.sdktestdemo.theme.utils.CustomThemeInterface;

/**
 * Created by Administrator on 2016/6/25.
 */
public class CustomThemeRecylerView extends RecyclerView implements CustomThemeInterface {
    public CustomThemeRecylerView(Context context) {
        super(context);
    }

    public CustomThemeRecylerView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomThemeRecylerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public View getView() {
        return this;
    }

    @Override
    public void setTheme(Resources.Theme themeId) {
        Adapter adapter = getAdapter();
        if (adapter != null) {
            adapter.notifyDataSetChanged();
        }
    }
}
